﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MC_Launcher.Classes;
using MC_Launcher.Classes.Config;

namespace MC_Launcher
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void MinRam_Scroll(object sender, EventArgs e)
        {
            bx_Min.Text = MinRam.Value.ToString();
        }


        private bool DebugConsole;
        private bool OnlineMode;
        private string MCSessionID;

        private void Form1_Load(object sender, EventArgs e)
        {
            checkBox2.Checked = Convert.ToBoolean(ConfigReadWrite.Instance.CurrentConfig.Online);
            //These need to be changed later
            bx_Max.Text = MaxRam.Value.ToString();
            bx_Min.Text = MinRam.Value.ToString();
            /// Need to set up a Mix and Max Range Value for both MinRam and MaxRam in Megabytes
            //MinRam.Minimum = 512;
           // MinRam.Maximum = 
        }

        private void MaxRam_Scroll(object sender, EventArgs e)
        {
            bx_Max.Text = MaxRam.Value.ToString();
        }

        private void btn_Login_Click(object sender, EventArgs e)
        {
            if (OnlineMode == true)
            {
               MCSessionID =  MCLogin.generateSession(bx_Username.Text, bx_Password.Text, ConfigReadWrite.Instance.CurrentConfig.ClientVersion.ToString());
               MessageBox.Show("Session ID: " + MCSessionID);
            }
        }

        private void btn_DwnldDSKModPk_Click(object sender, EventArgs e)
        {

        }

        private void btn_DwnldMC_Click(object sender, EventArgs e)
        {

        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox1.Checked == true) { DebugConsole = true; }
            else { DebugConsole = false; }
        }

        private void checkBox2_CheckedChanged(object sender, EventArgs e)
        {
            if (checkBox2.Checked == true) { OnlineMode = true; }
            else { OnlineMode = false; }
        }
    }
}
